'\" t
.\"     Title: ALTER FOREIGN DATA WRAPPER
.\"    Author: The PostgreSQL Global Development Group
.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
.\"      Date: 2011-12-01
.\"    Manual: PostgreSQL 9.1.2 Documentation
.\"    Source: PostgreSQL 9.1.2
.\"  Language: English
.\"
.TH "ALTER FOREIGN DATA WRAPPER" "7" "2011-12-01" "PostgreSQL 9.1.2" "PostgreSQL 9.1.2 Documentation"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
ALTER_FOREIGN_DATA_WRAPPER \- change the definition of a foreign\-data wrapper
.\" ALTER FOREIGN DATA WRAPPER
.SH "SYNOPSIS"
.sp
.nf
ALTER FOREIGN DATA WRAPPER \fIname\fR
    [ HANDLER \fIhandler_function\fR | NO HANDLER ]
    [ VALIDATOR \fIvalidator_function\fR | NO VALIDATOR ]
    [ OPTIONS ( [ ADD | SET | DROP ] \fIoption\fR [\*(Aq\fIvalue\fR\*(Aq] [, \&.\&.\&. ]) ]
ALTER FOREIGN DATA WRAPPER \fIname\fR OWNER TO \fInew_owner\fR
.fi
.SH "DESCRIPTION"
.PP

ALTER FOREIGN DATA WRAPPER
changes the definition of a foreign\-data wrapper\&. The first form of the command changes the support functions or the generic options of the foreign\-data wrapper (at least one clause is required)\&. The second form changes the owner of the foreign\-data wrapper\&.
.PP
Only superusers can alter foreign\-data wrappers\&. Additionally, only superusers can own foreign\-data wrappers\&.
.SH "PARAMETERS"
.PP
\fIname\fR
.RS 4
The name of an existing foreign\-data wrapper\&.
.RE
.PP
HANDLER \fIhandler_function\fR
.RS 4
Specifies a new handler function for the foreign\-data wrapper\&.
.RE
.PP
NO HANDLER
.RS 4
This is used to specify that the foreign\-data wrapper should no longer have a handler function\&.
.sp
Note that foreign tables that use a foreign\-data wrapper with no handler cannot be accessed\&.
.RE
.PP
VALIDATOR \fIvalidator_function\fR
.RS 4
Specifies a new validator function for the foreign\-data wrapper\&.
.sp
Note that it is possible that after changing the validator the options to the foreign\-data wrapper, servers, and user mappings have become invalid\&. It is up to the user to make sure that these options are correct before using the foreign\-data wrapper\&.
.RE
.PP
NO VALIDATOR
.RS 4
This is used to specify that the foreign\-data wrapper should no longer have a validator function\&.
.RE
.PP
OPTIONS ( [ ADD | SET | DROP ] \fIoption\fR [\*(Aq\fIvalue\fR\*(Aq] [, \&.\&.\&. ] )
.RS 4
Change options for the foreign\-data wrapper\&.
ADD,
SET, and
DROP
specify the action to be performed\&.
ADD
is assumed if no operation is explicitly specified\&. Option names must be unique; names and values are also validated using the foreign data wrapper\*(Aqs validator function, if any\&.
.RE
.SH "EXAMPLES"
.PP
Change a foreign\-data wrapper
dbi, add option
foo, drop
bar:
.sp
.if n \{\
.RS 4
.\}
.nf
ALTER FOREIGN DATA WRAPPER dbi OPTIONS (ADD foo \*(Aq1\*(Aq, DROP \*(Aqbar\*(Aq);
.fi
.if n \{\
.RE
.\}
.PP
Change the foreign\-data wrapper
dbi
validator to
bob\&.myvalidator:
.sp
.if n \{\
.RS 4
.\}
.nf
ALTER FOREIGN DATA WRAPPER dbi VALIDATOR bob\&.myvalidator;
.fi
.if n \{\
.RE
.\}
.SH "COMPATIBILITY"
.PP

ALTER FOREIGN DATA WRAPPER
conforms to ISO/IEC 9075\-9 (SQL/MED), except that the
HANDLER,
VALIDATOR
and
OWNER TO
clauses are extensions\&.
.SH "SEE ALSO"
CREATE FOREIGN DATA WRAPPER (\fBCREATE_FOREIGN_DATA_WRAPPER\fR(7)), DROP FOREIGN DATA WRAPPER (\fBDROP_FOREIGN_DATA_WRAPPER\fR(7))
